/**
 * Created by OneDream on 2016/1/14.
 */
$(document).ready(function(){
    var height=$(window).height();
    var width=$(window).width();
    var account=localStorage.getItem("account");
    //alert(account);
    //alert(height+"------"+width);
    $("#container").css("height",height);
    $("#container").css("width",width);
    $("#info").html("我的账号: "+account);
    $("#back img").click(function(){
        history.back();
    });
    $("#addF_btn").click(function(){
        var myaccount=localStorage.getItem("account");
        var account=$("#search_number").val();
        var address=$("#search_address").val();
        //alert(myaccount+"==="+account+"---"+address);
        $.ajax({
            url: "http://192.168.1.11:8080/WeiXin/addFriends",
            type:"post",
            data: $.toJSON({
                "myaccount": myaccount,
                "account":account,
                "address":address
            }),
            "contentType": "application/json",
            async: true,
            dataType: "json",
            success: function (data) {
                alert(data.message);
            },
            error: function () {
                alert("网络异常");
            }

        });
    });
});
